<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Change slaveOkay setting for this connection</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongo.setpoolsize.html">Mongo::setPoolSize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongo.switchslave.html">Mongo::switchSlave</a></div>
 <div class="up"><a href="class.mongo.html">Mongo</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongo.setslaveokay" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Mongo::setSlaveOkay</h1>
  <p class="verinfo">(PECL mongo &gt;=1.1.0)</p><p class="refpurpose"><span class="refname">Mongo::setSlaveOkay</span> &mdash; <span class="dc-title">Change slaveOkay setting for this connection</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongo.setslaveokay-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>Mongo::setSlaveOkay</strong></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$ok</code><span class="initializer"> = true</span></span>
  ] )</div>


  <p class="para rdfs-comment">
   See <a href="mongo.queries.html" class="link">the query section</a> of this manual for
   information on distributing reads to secondaries.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongo.setslaveokay-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">ok</code></em>
     </dt>

     <dd>

      <p class="para">
       If reads should be sent to secondary members of a replica set for all
       possible queries using this <a href="class.mongoclient.html" class="classname">MongoClient</a> instance.
      </p>
     </dd>

       
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongo.setslaveokay-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the former value of slaveOkay for this instance.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongo.setslaveokay-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>1.2.11</td>
       <td>Emits <strong><code>E_DEPRECATED</code></strong> when used.</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongo.setslaveokay-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><a href="mongo.readpreferences.html" class="xref">Read Preferences</a></li>
   <li class="member"><span class="methodname"><a href="mongoclient.setreadpreference.html" class="methodname" rel="rdfs-seeAlso">MongoClient::setReadPreference()</a> - 为该连接设置读取选项</span></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongo.setpoolsize.html">Mongo::setPoolSize</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongo.switchslave.html">Mongo::switchSlave</a></div>
 <div class="up"><a href="class.mongo.html">Mongo</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
